using System;
using System.Collections.Generic;
using System.Text;
using Calc.Execution;

namespace Calc.Operations
{
	public abstract class UnaryOperator : IOperator
	{
		protected IOperand _operand;

		public UnaryOperator(IOperand operand)
		{
			_operand = operand;
		}

		public IOperand Operand
		{
			get { return _operand; }
			set { _operand = value; }
		}

		public abstract CalcResult Calc(ExecutionContext context);

		public virtual int Precidence
		{
			get { return 100; }
		}

		public abstract string Symbol { get; }

		public abstract double GetValue(ExecutionContext context);


		public override string ToString()
		{
			string operand = "";

			if ( _operand != null )
				operand = _operand.ToString();

			return operand + Symbol;
		}

	}
}
